package com.max.back.demo.api;

import com.max.back.common.http.ResponseResult;
import com.max.back.demo.form.SickDrugForm;
import com.max.back.demo.service.ReDrugSer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 *退药控制器
 */
@CrossOrigin
@RestController
@RequestMapping("/api/redrug")
public class ReDrugCtl {
    /**
     *退药服务接口
     */
    @Autowired
    private ReDrugSer ser;

    @PostMapping("/ret")
    public ResponseResult<Boolean> send(@RequestBody SickDrugForm form) {
        boolean res = ser.updateredrug(form.getId());
        if (res) {
            return ResponseResult.getSuccessResult(true, "A006", null);
        } else {
            return ResponseResult.getMessageResult(false, "A007");
        }
    }
}
